/* -----------------------------------------------------------------------------
 * PROJECT    : net.lwf
 * FILE       : CommonUtil.java
 *
 * HISTORY:
 * Date          Author                        Description
 * ----------------------------------------------------------------------------- 
 * Dec 9, 2008       Raghu Sarraff			       Created
 */
package net.lwf.common.util;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

/**
 * Type the class description here
 *  
 */
public class CommonUtil {
	
	public static List toList(int[] nArray) {
		List lstData = new ArrayList(nArray.length);
		for(int i=0; i<nArray.length; i++) {
			lstData.add(String.valueOf(nArray[i]));
		}
		return lstData;
	}
	
	public static List toList(String number) {
		List lstData = new ArrayList(number.trim().length());
		for(int i=0; i<number.length(); i++) {
			lstData.add(String.valueOf(number.charAt(i)));
		}
		return lstData;
	}

	public static List getAllKeys(Map mapdata) {
		List lstData = null;
		if(mapdata != null) {
			lstData = new ArrayList(mapdata.size());
			Iterator iter = mapdata.entrySet().iterator();
			while(iter.hasNext()) {
				Map.Entry mapentry = (Map.Entry) iter.next();
				lstData.add(mapentry.getKey());
			}
		}
        return lstData;
	}
	
	public static void main(String[] args) {
	}
}

